--to get all locations, use the command "list locations":
set all_locations to list locations
--to set a location, make sure you are using a location that exists from the "list locations" command
set the_location to "Office"
if the_location is in (list locations) then set current location to the_location
--get the current location settings:
set current_location_settings to current location settings
--to set the current location settings, you use a record of one or more of the location settings
--to set the call type Dial Methods, the Dial Method must be one of the following constants:
--{Speaker, Modem, Bluetooth Phone, Asterisk, CallVantage, Cisco IP Phone, Phlink, PhoneValet, Skype, URL, Vonage, Xten Softphone}
--Note: if you try to set the Dial Method to a Method that is not available on your system,
--the set command will have no effect
--so, here are settings appropriate for New York City:
set current location settings to {preprocess number script:"", country:"United States", local country code:"+1", outside prefix enabled:false, outside prefix:"9,", call waiting prefix:"*70,", caller ID block prefix:"*82,", literal Dial Method:Speaker, maximum internal length:4, internal prefix:"", internal suffix:"", internal Dial Method:Speaker, maximum local length:7, local area codes:"212, 718, 917, 646", include local area code:true, local prefix:"1", local suffix:"", local Dial Method:Modem, domestic prefix:"1", domestic suffix:"", domestic Dial Method:Speaker, international delimiter:"+", include international delimiter:false, international prefix:"011", international suffix:"", international Dial Method:Speaker, toll free codes:"800, 866, 877, 888", toll free prefix:"1", toll free suffix:"", toll free Dial Method:Speaker, SIP Dial Method:URL}
--here are settings appropriate for using SkypeOut in the US:
set current location settings to {preprocess number script:"", country:"Custom", local country code:"", outside prefix enabled:false, outside prefix:"", call waiting prefix:"", caller ID block prefix:"", literal Dial Method:Skype, maximum internal length:4, internal prefix:"", internal suffix:"", internal Dial Method:Skype, maximum local length:7, local area codes:"", include local area code:true, local prefix:"+1", local suffix:"", local Dial Method:Skype, domestic prefix:"+1", domestic suffix:"", domestic Dial Method:Skype, international delimiter:"+", include international delimiter:false, international prefix:"", international suffix:"", international Dial Method:Skype, toll free codes:"800, 866, 877, 888", toll free prefix:"+1", toll free suffix:"", toll free Dial Method:Skype, SIP Dial Method:URL}
--get the current search site:
set current_search_site to current search site
--to get all search sites, use the command "list search sites":
set all_search_sites to list search sites
--to set a search site, make sure you are using a search site that exists from the "list search sites" command
set the_search_site to "Address Book"
if the_search_site is in (list search sites) then set current search site to the_search_site
--to get all recently dialed numbers, use the command "list recently dialed numbers":
set recently_dialed_numbers to list recently dialed numbers
--to get all Quick Dial Numbers, use the command "list Quick Dial Numbers":
set all_Quick_Dial_Numbers to list Quick Dial Numbers
--to add a new Quick Dial Number, send the command "add Quick Dial" with the parameters "name" and "number" (both required):
add Quick Dial contact name "NYC Information" contact number "(212) 555-1212"
--to get all available Dial Methods, use the command "list Dial Methods":
set all_Dial_Methods to list Dial Methods
--get the speaker settings:
set speaker_settings to speaker settings
--to set the speaker settings, you use a record of one or more of the speaker settings:
set speaker settings to {speaker dial speed:fast, speaker comma pause:1.5}
--get the modem settings:
set modem_settings to modem settings
--to set the modem settings, you use a record of one or more of the modem settings:
set modem settings to {device:"modem", init string:"AT&FS10=255", sound enabled:true, wait for dial tone:true, touchtones:true, hang up timeout:10, release on hang up:false, calling tones disabled:false, wait for response:true, redial on busy:false, redial on busy pause:1, redial on busy total attempts:5, call detection enabled:false, call detection rings:3, call detection alert enabled:false, call detection off hook enabled:false, external application on call detection:""}
--get the Bluetooth phone settings:
set bluetooth_settings to Bluetooth phone settings
--to set the Bluetooth settings, you use a record of one or more of the Bluetooth settings:
set Bluetooth phone settings to {device:"Bluetooth-Modem", init string:"AT&F", alternate mobile dial string:false}
--get the Asterisk settings:
set asterisk_settings to Asterisk settings
--to set the Asterisk settings, you use a record of one or more of the Asterisk settings:
set Asterisk settings to {Asterisk username:"", Asterisk password:"", Asterisk extension:"", Asterisk connected device type:SIP Phone or Adapter, Asterisk context:"", Asterisk caller ID:"", Asterisk verbose logging enabled:true, Asterisk local server:false, Asterisk remote IP:"127.0.0.1", Asterisk remote server port:5038}
--get the CallVantage settings:
set callvantage_settings to CallVantage settings
--to set the CallVantage settings, you use a record of one or more of the CallVantage settings:
set CallVantage settings to {CallVantage number:"2125551212", CallVantage password:""}
--get the Cisco IP Phone settings:
set cisco_settings to Cisco IP Phone settings
--to set the Cisco IP Phone settings, you use a record of one or more of the Cisco settings:
set Cisco IP Phone settings to {Cisco username:"", Cisco password:"", Cisco IP address:"192.168.0.100", Cisco priority:0}
--get the Phlink settings (you can return these even if Ovolab Phlink is not available on your system):
set phlink_settings to Phlink settings
--to set the Phlink settings, you use a record of one or more of the Phlink settings:
set Phlink settings to {Phlink recording enabled:true, Phlink silence detection enabled:true, Phlink hang up timeout:10, Phlink remote:true, Phlink remote username:"", Phlink remote password:"", Phlink remote IP address:"192.168.0.100"}
--get the PhoneValet settings (you can return these even if Parliant's PhoneValet is not available on your system):
set phonevalet_settings to PhoneValet settings
--to set the PhoneValet settings, you use a record of one or more of the PhoneValet settings (well, there's currently only one setting):
set PhoneValet settings to {PhoneValet dial exact:true, PhoneValet remote:true, PhoneValet remote username:"", PhoneValet remote password:"", PhoneValet remote IP address:"192.168.0.100"}
--get the URL settings
set url_settings to URL settings
--to set the URL settings, you use a record of one or more of the URL settings:
set URL settings to {DM URL:"http://www.google.com/search?sa=X&oi=fwp&pb=f&q=%#", DM URL called silently:false, DM URL encoding:None}
--get the Vonage settings:
set vonage_settings to Vonage settings
--to set the Vonage settings, you use a record of one or more of the Vonage settings:
set Vonage settings to {Vonage username:"", Vonage password:"", Vonage number:""}
--get the Xten softphone settings (you can return these even if no Xten softphone is available on your system):
set xten_settings to Xten softphone settings
--to set the Xten softphone settings, you use a record of one or more of the Xten softphone settings:
set Xten softphone settings to {Xten strip formatting:true, Xten delay dial:15}
--get the call timer settings:
set call_timer_settings to call timer settings
--to set the call timer settings, you use a record of one or more of the call timer settings
--Note: "timer enabled" is a read-only property
--to start or stop a timer, use the "start timer" & "stop timer" commands
set call timer settings to {timer frequency:0.5, beep enabled:true, auto start:false, timer reset on start:true}
--get the application preferences:
set application_preferences to {launch status window enabled:launch status window enabled, startup item enabled:startup item enabled, main window shows on launch:main window shows on launch, textures enabled:textures enabled, status window enabled:status window enabled, alternate main enabled:alternate main enabled, main opacity:main opacity, main shadow enabled:main shadow enabled, recents menu max:recents menu max, separate recently dialed numbers menu enabled:separate recently dialed numbers menu enabled, separate Quick Dial menu enabled:separate Quick Dial menu enabled, hide PIM on lookup:hide PIM on lookup, global hotkey enabled:global hotkey enabled, global hotkey:global hotkey, global hotkey use Control modifier:global hotkey use Control modifier, global hotkey use Option modifier:global hotkey use Option modifier, global hotkey use Shift modifier:global hotkey use Shift modifier, convert mnemonics on dial:convert mnemonics on dial, include clipboard extras:include clipboard extras, voice enabled:voice enabled, tool tips enabled:tool tips enabled, JPT shows in Dock enabled:JPT shows in Dock enabled, dial confirmation enabled:dial confirmation enabled, external application on dial:external application on dial, pause iTunes on dial:pause iTunes on dial, change iTunes volume on dial:change iTunes volume on dial, iTunes volume on dial:iTunes volume on dial, pause DVD Player on dial:pause DVD Player on dial, change iChat status on dial:change iChat status on dial, iChat status on dial:iChat status on dial}
--to set the application preferences, set them individually. E.g.,:
set separate Quick Dial menu enabled to (not (separate Quick Dial menu enabled))
--if you have your preferences set such that JPT pauses iTunes, DVD Player, or modifies your iChat status, you can rest these applications by issueing a "restore iApp status" command:
restore iApp status
set the_number to "212-555-1212"
--to have the user enter the number, un-comment the next line:
--set the_number to text returned of (display dialog "What number shall I dial?" default answer the_number)
--to grab the number from the clipboard, un-comment the next line:
--set the_number to (the clipboard)
--to take the value from a cell in FMP, un-comment the following code:
(*
property cell_name : ""
repeat while cell_name = ""
set cell_name to text returned of (display dialog "What cell name should I use?" default answer cell_name)
end repeat
try
tell application "FileMaker Pro" to set the_number to cellValue of cell cell_name of current record of database 1
on error the_error
beep
display dialog the_error buttons {"OK"} default button 1 with icon 0 giving up after 10
set cell_name to ""
return
end try
*)
--to dial a number (make sure JPT's dialing parameters are properly set--see above):
dial number the_number
--to dial a number and to set the name used in the dial log, use the optional "name" parameter:
dial number the_number name "NYC Information" --with literal
--if your number is already completely formatted with the appropriate prefixes and suffixes, you
--can tell JPT to dial the number exactly as formatted without adding any additional prefixes or
--suffixes that it would otherwise add by using the optional "literal" parameter.
--This does not change the configuration of JPT, for that set the current location settings as described above.
set the_number to "9,1-212-555-1212" --a completely formatted number
dial number the_number name "NYC Information" with literal
--to lookup a name, you need to specify a search site, so let's get them all:
set all_search_sites to list search sites
--now that you have the search sites, lookup someone:
set the_name to "Apple" -- string
set search_site to (item 1 of all_search_sites) -- string from fixed set of search sites
activate
lookup contact the_name search site search_site
--to constrain the search to companies only, use the optional "companies only" parameter:
activate
lookup contact the_name search site search_site with companies only
--to convert a mnemonic string to a phone number:
set the_mnemonic to "1-800-SOS-APPL" -- string
set converted_mnemonic to convert mnemonic the_mnemonic
--to use the timer, you need to set a frequency and whether or not to use a beep:
set the_frequency to 0.5 -- real number as minutes, e.g., 0.5 = 30 seconds
start timer frequency the_frequency with beep and reset
delay 41 --wait for the timer to fire once and the alert to dismiss itself then stop the timer